<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-08-05 15:16:04
 * @LastEditTime: 2019-09-09 09:26:13
 * @LastEditors: Please set LastEditors
 -->
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/vant.css">
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <link rel="stylesheet" type="text/css" href="../css/local.css" />
    <script type="text/javascript" src="../script/jquery.js"></script>
    <script type="text/javascript" src="../script/vue.min.js"></script>
    <script src="../script/vant.min.js"></script>
    <script type="text/javascript" src="../script/fastclick.js"></script>
    <script type="text/javascript" src="../script/base.js"></script>
    <style type="text/css">
        .row {
            padding: 10px 10px 0 10px;
        }

        .row:last-child {
            padding-bottom: 10px;
        }

        .row>div {
            background: #fff;
            overflow: hidden;
            border-radius: 4px;
            padding: 10px;
            font-size: 14px;
        }
        .pr{
            color: #cd1b21;
        }
        .ov {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 14px;
        }

        .rg {
            color: #969799;
            text-align: right;
        }
        .money{
            line-height: 40px;
        }
        .money span {
            font-size: 26px;
            font-weight: 700;
            margin-right: 5px;
        }
        .pd{
            line-height: 28px;
        }
        .pd span{
            color: #969799;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak >
        <div class="init-full">
            <van-nav-bar class="head" title="支付记录" left-arrow @click-left="onClickLeft"></van-nav-bar>
            <div class="body-no-bottom">
                <div class="content">
                    <van-list v-model="listLoading" :finished="listFinished" finished-text="没有更多了" @load="listOnLoad">
                        <div class="row" v-for="(row,index) in dataList">
                            <div>
                                <van-row gutter="20">
                                    <van-col span="12" class="ov" :class="row.PStatus == '失败'?'pr':''">支付{{row.PStatus}}</van-col>
                                    <van-col span="12" class="rg">{{row.CreateTime}}</van-col>
                                </van-row>
                                <div class="money"><span>{{row.DMoney}}</span>元</div>
                                <div class="pd">订单编号：&nbsp;&nbsp;&nbsp;&nbsp;<span>{{row.CONTNO}}</span></div>
                                <div class="pd">支付方式：&nbsp;&nbsp;&nbsp;&nbsp;<span>{{row.PayType}}</span></div>
                                <div class="pd">支付说明：&nbsp;&nbsp;&nbsp;&nbsp;<span>{{row.ZFYY}}</span></div>
                            </div>
                        </div>
                    </van-list>
                </div>
                <van-loading v-if="showLoading" />
            </div>
        </div>


    </div>
</body>

<script type="text/javascript">
    var vm;
    apiready = function () {
        //$('.init-full').show();

        var userInfo = FLD.getUserInfo();

        vm = new Vue({
            el: '#app',
            data: {
                showLoading: false,
                listLoading: false,
                listFinished: true,
                dataList: [],
                pageIndex: 1,
                pageSize: 20

            },
            created: function () {
                this.getPayRecord();
            },
            methods: {
                getPayRecord() {
                    var that = this;
                    that.showLoading = true;
                    var obj = {
                        S_UserType: 2,
                        S_Pageindex: that.pageIndex,
                        S_PageSize: that.pageSize
                    }
                    FLD.ajax('AP_WLPayListNY', obj, function (res) {
                        that.showLoading = false;
                        that.listFinished = false;
                        that.dataList = res.ds;
                    })
                },
                listOnLoad(index) {
                    var that = this;
                    that.pageIndex++;
                    var obj = {
                        S_UserType: 2,
                        S_Pageindex: that.pageIndex,
                        S_PageSize: that.pageSize
                    }
                    FLD.ajax('AP_WLPayListNY', obj, function (res) {
                        that.listLoading = false;
                        if (res.ds.length == 0) {
                            that.listFinished = true;
                        }
                        that.dataList = that.dataList.concat(res.ds);
                    })
                },

                onClickLeft() {
                    api.closeWin();
                }
            }
        })
    };
</script>

</html>